package com.dingli.shop.controller;

import com.dingli.shop.biz.LoginBiz;
import com.dingli.shop.biz.MyBiz;
import com.dingli.shop.entity.TUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

@Controller
public class MyController {

    @Autowired
    private MyBiz biz;

    @RequestMapping(value = "/mygrxx1")
    public String mygrxx1(){
        return "mygrxx";
    }

    @RequestMapping(value = "/mygxin1")
    public String mygxin1(){
        return "mygxin";
    }

    @RequestMapping(value = "/index1")
    public String index1(){
        return "index";
    }

    @RequestMapping(value = "/paint1")
    public String paint1(){
        return "paint";
    }

    @RequestMapping(value = "/flowerDer1")
    public String flowerDer1(){
        return "flowerDer";
    }

    @RequestMapping(value = "/proList1")
    public String proList1(){
        return "proList";
    }

    @RequestMapping(value = "/vase_proList1")
    public String vase_proList1(){
        return "vase_proList";
    }

    @RequestMapping(value = "/decoration1")
    public String decoration1(){
        return "decoration";
    }

    @RequestMapping(value = "/zbproList1")
    public String zbproList1(){
        return "zbproList";
    }
    @RequestMapping(value = "/bzproList1")
    public String bzproList1(){
        return "bzproList";
    }

    @RequestMapping(value = "/perfume1")
    public String perfume1(){
        return "perfume";
    }

    @RequestMapping(value = "/idea1")
    public String idea1(){
        return "idea";
    }


    @RequestMapping(value = "/remima1")
    public String remima1(){
        return "remima";
    }



    //个人信息
    @PostMapping(value = "/mygrxx")//前端传递过来的数据 可以构成user对象
    public String mygrxx(TUser user, Model model, HttpServletRequest request) {
        request.getSession().setAttribute("users",user);

        return  "mygrxx";
    }

    //修改个人信息
    @PostMapping(value = "/mygxin")//前端传递过来的数据 可以构成user对象
    public String mygxin(TUser user, Model model, HttpServletRequest request) {
        request.getSession().setAttribute("users",user);

        return  "mygxin";
    }

    //首页
    @PostMapping(value = "/index")//前端传递过来的数据 可以构成user对象
    public String index(TUser user, Model model, HttpServletRequest request) {
        request.getSession().setAttribute("users",user);

        return  "index";
    }



}
